{include file="common/header.tpl"}
{if $AppUI->id <= 0}
	{include file="index/login.tpl"}  
{else}
	{include file="common/menu.tpl"}
    <div class="rightColumn">
    	<div class="boxContent">
        	<div class="contentItem">
                <div class="contentItems">
                	<div class="headerTitle"><h2>{if isset($arrEdu)}<a href="{$smarty.const.HOST_BACKEND}product/cmt">Đánh giá - bình luận</a> &raquo; {$arrEdu.name}{else}Đánh giá - bình luận{/if}</h2></div> 
                    <form name="frmSearch" id="frmSearch" action="{$smarty.const.HOST_BACKEND}product/cmt" onsubmit="javascript:return actionSearch();" method="get" enctype="multipart/form-data">
	                	{include file="product/search-cmt.tpl"}
                    </form>
                    <form name="frmEducation" id="frmEducation" action="{$smarty.const.HOST_BACKEND}product/acmt" method="post" enctype="multipart/form-data">
                    	<input type="hidden" name="paction" id="paction"/>
                        <input type="hidden" name="pbackurl" id="pbackurl" value="{$smarty.const.HOST_BACKEND}product/cmt"/>
                        <div class="secData">
                            {if $arrResult}
                                <div class="secActionAndPage">
                                    <div class="actionLink">
                                        {if isset($smarty.session.product)}                                                 
                                            {if ($smarty.session.product&1<<5) > 0 && $AppUI->type == 2}
                                                <input type="button" onclick="javascript:confirmActive(this.form);" class="btnLarge" value="Kích hoạt / Phục hồi"/>
                                            {/if}                                                                                   
                                            {if ($smarty.session.product&1<<3) > 0}  
                                                <input type="button" onclick="javascript:confirmDelete(this.form);" value="Xóa"/>
                                                {if $AppUI->type > 1}
                                                    <input type="button" onclick="javascript:confirmDeleteDb(this.form);" value="Xóa khỏi Db"/>
                                                {/if}
                                            {/if}
                                        {else}
                                            &nbsp;
                                        {/if}
                                    </div>
                                    <div class="totalPage"><strong>Tổng số: {$intTotal}</strong></div>
                                </div>
                            {/if}
                            <table width="100%" cellpadding="0" cellspacing="0" border="0">
                                <thead>
                                    <tr>
                                        {if $arrResult && isset($smarty.session.product) && ( (($smarty.session.product&1<<3)>0) || (($smarty.session.product&1<<4)>0) )}
                                            <th class="firstChild" width="30"><input type="checkbox" name="pcheckall" id="pcheckall" onclick="javascript:checkAll(this.form,'pecmtid[]',this.checked);"/></th>
                                            <th width="200">Tên trường</th>
                                        {else}
                                            <th class="firstChild" width="200">Tên trường</th>
                                        {/if}    
                                        <th>Nội dung đánh giá - bình luận</th>
                                        <th width="120">Đăng bởi</th>
                                        <th width="80">Ngày đăng</th>
                                        {if $arrResult && isset($smarty.session.product) && ($smarty.session.product&1<<2)>0}
                                            <th width="26">&nbsp;</th>
                                        {/if}
                                    </tr>
                                </thead>
                                <tbody>
                                    {if $arrResult}
                                        {foreach item=item from=$arrResult}
                                            <tr class="{cycle values="odd,even"}">
                                                {if isset($smarty.session.product) && ((($smarty.session.product&1<<3)>0) || (($smarty.session.product&1<<4)>0))}
                                                    <td class="firstChild" align="center">
                                                        <input type="checkbox" id="pecmtid{$item.ecmtid}" name="pecmtid[]" value="{$item.ecmtid}" onclick="javascript:checkOneItem(this.form, 'pcheckall')"/>
                                                    </td>
                                                    <td><a href="{$smarty.const.HOST_BACKEND}product/cmt?eduid={$item.id}">{$item.education_name}</a></td>
                                                {else}
                                                    <td class="firstChild"><a href="{$smarty.const.HOST_BACKEND}product/cmt?eduid={$item.id}">{$item.education_name}</a></td>
                                                {/if}
                                                <td>
                                                	{if $item.title}<strong>{$item.title}</strong>{/if}
                                                    <div class="line">
                                                    	{$item.content}
                                                    </div>
                                                </td> 
                                                <td><a href="{$smarty.const.HOST_BACKEND}user/detail?uid={$item.userid}" target="_blank">{$item.userid|ouser}</a></td>
                                                <td align="center">{$item.postdate|date_format:"%d/%m/%Y"}<br/>{$item.postdate|date_format:"%H:%M:%S"}</td>
                                                {if ($smarty.session.product&1<<2)>0}
                                                	<td align="center">                                                    
                                                        <a href="{$smarty.const.HOST_BACKEND}product/cmte?ecmtid={$item.ecmtid}" title="Cập nhật thông tin">
                                                            <img src="{$smarty.const.HOST_STATICS}img/icon/ad-edit.png" alt="Edit" border="0" width="16" height="16" />
                                                        </a>
                                                	</td>
                                                {/if}
                                            </tr>
                                        {/foreach}
                                    {else}
                                        <tr><td colspan="7" align="center">Không có dữ liệu</td></tr>
                                    {/if}
                                </tbody>
                            </table>
                            {if $arrResult}
                                <div class="secActionAndPage">
                                    <div class="actionLink">
                                        {if isset($smarty.session.product)} 
                                            {if ($smarty.session.product&1<<5) > 0 && $AppUI->type == 2}
                                                <input type="button" onclick="javascript:confirmActive(this.form);" class="btnLarge" value="Kích hoạt / Phục hồi"/>
                                            {/if}                                                                                  
                                            {if ($smarty.session.product&1<<3) > 0}  
                                                <input type="button" onclick="javascript:confirmDelete(this.form);" value="Xóa"/>
                                                {if $AppUI->type > 1}
                                                    <input type="button" onclick="javascript:confirmDeleteDb(this.form);" value="Xóa khỏi Db"/>
                                                {/if}
                                            {/if}
                                        {else}
                                            &nbsp;
                                        {/if}
                                    </div>
                                    {paging total=$intTotal limit=$intLimit offset=$intOffset url=$strUrl}
                                </div>
                            {/if}
                        </div>
                	</form>
                </div>
          	</div>
        </div>
    </div>
{/if}
{include file="common/footer.tpl"}
                
